home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Answers 2002 January
/
PC Answers January 2002.7z
/
PC Answers January 2002.bin
/
graphics
/
freepixl
/
_SETUP.1
/
japan.pxl
< prev
next >
Wrap
Text File
|
2000-04-03
|
23KB
|
837 lines
UseCoordinates(PIXEL)
UseFont("Arial",5,15,NOBOLD,NOITALIC,NOUNDERLINE,0,0,255)
SetColorPalette(BITMAP)
WinGetActive(Win$)
Title$ = "Main Display Window"
UseCaption(Title$)
WinLocate(Title$,10,20,770,540,Res)
WinShow(Title$,NOTOPMOST,Res)
UseBackground(TRANSPARENT,192,192,192)
DrawBackground
DirGet(SourceDir$)
Scene1$ = SourceDir$ + "\furfcomp.bmp"
Scene2$ = SourceDir$ + "\furtclas.bmp"
WorkbenchTitle$ = "RSI Workbench Simulation"
ShowGrid = 0
Chr(12,CR$)
Chr(10,LF$)
CRLF$ = CR$ + LF$
Chr(9,TAB$)
PenSize = 1
PenR = 0
PenG = 0
PenB = 0
InfoMenu(REMOVE)
WaitInput(100)
GoSub MainFrameMenu
GoSub Initial_Help
Wait_for_Input:
WaitInput()
Leave:
GoSub CloseAllWorkbenches
End
MapTitle:
Label$ = "Current Map Title"
MapTitle$ = "Furano City, Hokkaido"
Text$ ="Enter the required map title, set the font, and then click in the image to set the title position."
TextBox(Text$,Label$,MapTitle$,Btn)
If Btn = 2 Then Goto Wait_for_Input
W = 0 H = 0 R = 0 G = 0 B = 0
ChooseFont(Font$,W,H,R,G,B, Bold, Ital,Undl,Strike)
UseFontExt(Font$,W,H,Bold, Ital,Undl,Strike, R,G,B)
UseCursor(CROSS)
SetMouse(10,40,Pixels,Lines,MouseTitle,qX,qY)
WaitInput()
MouseTitle:
DrawText(qX,qY, MapTitle$)
UseCursor(ARROW)
SetMouse(10,40,Pixels,Lines,PopupOpsFill,LX,LY)
Goto Wait_for_Input
FireWorkbench:
Filter$ = "Workbench Files (*.wbh),*.wbh"
InitFile$ = "*.wbh"
InitDir$ = SourceDir$
Label$ = "Select a Workbench file to open"
FileSaveAs(Filter$,InitFile$,InitDir$,Label$,CHANGEDIR,Name$)
If Name$ = "" Then Goto Wait_for_Input
CmdLine$ = "PiXCL44 wrkbnch1.pxl"
Run(CmdLine$)
DrawStatusWinText(1,Name$)
Goto Wait_for_Input
Floodworkbench:
Filter$ = "Workbench Files (*.wbh),*.wbh"
InitFile$ = "*.wbh"
InitDir$ = SourceDir$
Label$ = "Select a Workbench file to open"
FileSaveAs(Filter$,InitFile$,InitDir$,Label$,CHANGEDIR,Name$)
If Name$ = "" Then Goto Wait_for_Input
CmdLine$ = "PiXCL44 wrkbnch2.pxl"
Run(CmdLine$)
DrawStatusWinText(1,Name$)
Goto Wait_for_Input
TransportWorkbench:
Filter$ = "Workbench Files (*.wbh),*.wbh"
InitFile$ = "*.wbh"
InitDir$ = SourceDir$
Label$ = "Select a Workbench file to open"
FileSaveAs(Filter$,InitFile$,InitDir$,Label$,CHANGEDIR,Name$)
If Name$ = "" Then Goto Wait_for_Input
CmdLine$ = "PiXCL44 wrkbnch3.pxl"
Run(CmdLine$)
DrawStatusWinText(1,Name$)
Goto Wait_for_Input
PopupContext:
Demo:
MessageBox(OK,1,INFORMATION,"Function not implemented in this sample program.","PiXCL 4.4 Demo",Res)
Goto Wait_for_Input
ImportOverlayDemo:
SetMouse()
SetRightMouse()
LoadBitmap(Scene2$,FULL)
DrawBitmap(10,40,Scene1$)
OverlayImage(Scene2$,0,0,0,Res)
DrawBitmap(10,40,Scene1$)
GetBitmapDim(Scene1$,Lines,Pixels,Bits)
DrawStatusWinText(1,"Overlay#1 loaded")
Lines +=40
Pixels +=10
Goto Wait_for_Input
NewDemo:
GoSub ApplicationFrameMenu
GoSub Create_ToolWindow
DrawBitmap(10,40,Scene1$)
GetBitmapDim(Scene1$,Lines,Pixels,Bits)
Lines +=40
Pixels +=10
Goto Wait_for_Input
PopupOps:
GetPixel(rX,rY,mR,mG,mB,Res)
ChooseColor(STD,Red,Green,Blue)
UseBrush(SOLID,Red,Green,Blue)
DrawFloodExt(rX,rY,mR,mG,mB,SURFACE)
SetMouse(10,40,Pixels,Lines,PopupOpsFill,LX,LY)
Goto Wait_for_Input
PopupOpsEdit:
GetMenuStatus("Edit Overlay Color",CHECKED,OverlayEditEnabled)
If OverlayEditEnabled = 0 {so enable overlay edit operations with mouse}
SetRightMouse(10,40,Pixels,Lines,PopupOps,rX,rY)
SetDrawMouse(BOTH)
ChangeMenuItem("Edit Overlay Color",CHECK,Res)
Endif
If OverlayEditEnabled = 0 Then Goto PopUpOpsFill
If OverlayEditEnabled = 1 {turn off overlay edit operations}
ChangeMenuItem("Edit Overlay Color",UNCHECK,Res)
UseBrush(SOLID,255,255,255)
Endif
If OverlayEditEnabled = 1 Then Goto PopUpOpsFillEnd
PopupOpsFill:
GetPixel(LX,LY,mR,mG,mB,Res)
DrawFloodExt(LX,LY,mR,mG,mB,SURFACE)
Goto Wait_for_Input
PopupOpsFillEnd:
SetDrawMouse(DISABLE)
SetMouse()
SetRightMouse()
SetShftMouse()
Goto Wait_for_Input
DeleteOverlayDemo:
SetMouse()
SetRightMouse()
DrawBitmap(10,40,Scene1$)
DrawStatusWinText(1,"")
Goto Wait_for_Input
DrawGrid:
UsePen(SOLID,1,0,0,0)
{10,40,Pixels,Lines are the image display coords}
For i=10 To Pixels By 40
If i > Pixels Then Break
DrawLine(i,40,i,Lines)
Next
For i=40 To Lines By 40
If i > Lines Then Break
DrawLine(10,i,Pixels,i)
Next
Goto Wait_for_Input
OpenImage:
GoSub MakeFilter
InitFile$ = "*.bmp"
InitDir$ = SourceDir$
Label$ = "Open an image for display"
WaitInput(1) {let windows catch up}
FileGet(Filter$,InitFile$,InitDir$,Label$,CHANGEDIR,Name$)
If Name$ = "" Then Goto Wait_for_Input
GoSub ApplicationFrameMenu
GoSub Create_Toolwindow
FreeBitmap(Name$) {just in case its loaded}
ImageWindow1$ = "ImageWindow#1: " + Name$
DrawBitmap(10,40,Name$)
DrawStatusWinText(0,"Base image loaded.")
GetBitmapDim(Scene1$,Lines,Pixels,Bits)
Lines +=40
Pixels +=10
SetRightMouse(10,40,Pixels,Lines,PopupOps,rX,rY)
SetMouse(10,40,Pixels,Lines,PopupOpsFill,LX,LY)
Goto Wait_for_Input
CloseImage:
GoSub MakeFilter
InitFile$ = "*.bmp"
InitDir$ = SourceDir$
Label$ = "Save the current image"
WaitInput(1) {let windows catch up}
FileSaveAs(Filter$,InitFile$,InitDir$,Label$,CHANGEDIR,Name$)
If Name$ = "" Then Goto Wait_for_Input
GoSub MainFrameMenu
ToolWindow()
DrawStatusWinText(0,"No image loaded.")
Goto Wait_for_Input
OpenWBH:
Filter$ = "Workbench Files (*.wbh),*.wbh"
InitFile$ = "*.wbh"
InitDir$ = SourceDir$
Label$ = "Select a Workbench file to open"
FileSaveAs(Filter$,InitFile$,InitDir$,Label$,CHANGEDIR,Name$)
If Name$ = "" Then Goto Wait_for_Input
GoSub ApplicationFrameMenu
DrawBitmap(10,40,Scene1$)
CmdLine$ = "PiXCL41 workbench1.pxl"
Run(CmdLine$)
DrawStatusWinText(1,Name$)
Goto Wait_for_Input
CloseWBH:
Filter$ = "Workbench Files (*.wbh),*.wbh"
InitFile$ = "*.wbh"
InitDir$ = SourceDir$
Label$ = "Save the current Workbench"
FileSaveAs(Filter$,InitFile$,InitDir$,Label$,CHANGEDIR,Name$)
If Name$ = "" Then Goto Wait_for_Input
GoSub MainFrameMenu
ToolWindow()
ToolWindowView = 0
GoSub CloseAllWorkbenches
Goto Wait_for_Input
About:
AboutUser("About ...","Interface Design Simulation",
"This program demonstrates user interface and image display options using PiXCL.")
Goto Wait_for_Input
ColorTable:
CustomColor(255,0,0, 0,255,0, 0,0,255, 255,255,0,
0,255,0, 0,255,255, 192,192,192, 255,160,0,
160,255,0, 0,255,160, 0,0,255, 255,255,0,
0,255,0, 0,255,255, 255,255,255, 255,255,255)
Red = 255 Green = 0 Blue = 255
ChooseColor(STD,Red,Green,Blue)
Goto Wait_for_Input
BrowseDemoR:
GoSub MakeFilter
InitDir$ = SourceDir$
InitFile$ = ""
Label$ = "Select an image file"
FileGet(Filter$,InitFile$,InitDir$,Label$,CHANGEDIR,Image$)
If Image$ = "" Then Goto Wait_for_Input
Text$ =
"Text that appears in the imagebox,
would list known information about
the selected image. This could be
metadata embedded in the file
e.g. in geoTIFF, or data from an
external file or database access."
ImageBox("Browse Raster Images",Image$, Text$,
"&Button#1", "&More Info",Btn)
FreeBitMap(Image$)
Goto Wait_for_Input
BrowseDemoV:
GoSub MakeVectorFilter
InitDir$ = SourceDir$
InitFile$ = ""
Label$ = "Select an image file"
FileGet(Filter$,InitFile$,InitDir$,Label$,CHANGEDIR,Image$)
If Image$ = "" Then Goto Wait_for_Input
Text$ =
"Text that appears in the imagebox,
would list known information about
the selected image. This could be
metadata embedded in the file
e.g. in geoTIFF, or data from an
external file or database access."
ImageBox("ImageBox Title line",Image$, Text$,
"&Button#1", "&More Info",Btn)
FreeBitMap(Image$)
Goto Wait_for_Input
BrowseDemoS:
Goto Wait_for_Input
PrintFileDialog:
PrintFile("i:\v\v_image.ini",Res)
Goto Wait_for_Input
ToggleToolbar:
If ToolbarStatus = 0
DrawBitmap(0,0,Image4$)
If EditBarView = 1 Then DrawBitmap(364,0,Image3$)
ChangeMenuItem("&Toolbar",CHECK,Res)
ToolbarStatus = 1
Else
UseBrush(SOLID,192,192,192)
UsePen(SOLID,1,192,192,192)
WinGetClientRect("",cx1,cy1,cx2,cy2)
DrawRectangle(cx1,0,cx2,34)
ChangeMenuItem("&Toolbar",UNCHECK,Res)
ToolbarStatus = 0
Endif
Goto Wait_for_Input
ToggleStatusBar:
If StatusBarView = 0
StatusWindow(ENABLE,BOTTOM,3,200,550,-1,0)
StatusBarView = 1
ChangeMenuItem("&Statusbar",CHECK,Res)
Else
StatusWindow(DISABLE,BOTTOM,3,200,550,-1,0)
StatusBarView = 0
ChangeMenuItem("&Statusbar",UNCHECK,Res)
Endif
Goto Wait_for_Input
ClearArea:
UseBrush(SOLID,255,255,255)
DrawRectangle(10,40,Pixels,Lines)
Goto Wait_for_Input
EditPenStyles:
ChooseColor(STD,PenR,PenG,PenB)
TextBox("Enter the pen size","Draw with Pen",PenSize$,Btn)
If Btn = 2 Then Goto Wait_for_Input
Val(PenSize$,PenSize,Res)
If Res = 0 Then PenSize = 1
Goto Wait_for_Input
DrawVectorLabels:
UseFont("Arial",7,13,NOBOLD,NOITALIC,NOUNDERLINE,0,0,0)
GoSub DrawVectorLabelFileContents
Goto Wait_for_Input
DrawVectors: {read an IDRISI style .vec file}
Filter$ = "Vector Files(*.vec),*.vec)"
InitDir$ = SourceDir$
InitFile$ = "*.vec"
Label$ = "Select a Vector file to draw on current map."
FileGet(Filter$, InitFile$, InitDir$,Label$,CHANGEDIR,VectorFile$)
If VectorFile$ = "" Then Goto Wait_for_Input
GoSub DrawVectorFileContents
Goto Wait_for_Input
DrawVectorSet:
Filter$ = "Vector Files(*.vec),*.vec)"
InitDir$ = SourceDir$
InitFile$ = "*.vec"
Label$ = "Select a Vector file set to draw on current map."
FileGet(Filter$, InitFile$, InitDir$,Label$,CHANGEDIRMULTI,VectorFileSet$)
If VectorFileSet$ = "" Then Goto Wait_for_Input
{path file file file ... make the set of filenames and draw the contents}
Instr(VectorFileSet$," ",spLoc)
If spLoc = 0 Then Goto Wait_for_Input
LeftOf(VectorFileSet$,spLoc,Path$) Path$ = Path$ +"\"
RightOf(VectorFileSet$,spLoc,VectorFileSet$)
Instr(VectorFileSet$," ",vspLoc)
Loop:
If vspLoc = 0 Then Name$ = VectorFileSet$ VectorFileSet$ = ""
If vspLoc > 0 Then LeftOf(VectorFileSet$,vspLoc,Name$)
VectorFile$ = Path$ + Name$
RightOf(VectorFileSet$,vspLoc,VectorFileSet$)
GoSub DrawVectorFileContents
Len(VectorFileSet$,Long)
Instr(VectorFileSet$," ",vspLoc)
If Long <> 0 Then Goto Loop
Goto Wait_for_Input
DigitizeVectors: {create an IDRISI style .vec file}
WaitInput(1)
Filter$ = "Vector Files(*.vec),*.vec"
InitDir$ = SourceDir$
InitFile$ = "project.vec"
Label$ = "Select a Vector filename to digitize from current map."
FileGet(Filter$, InitFile$, InitDir$,Label$,CHANGEDIR,VectorFile$)
If VectorFile$ = "" Then Goto Wait_for_Input
GoSub CreateVectorFile
Goto Wait_for_Input
DigitizeVectorsHelp:
MessageBox(OK,1,INFORMATION,
"When you select this option, the cursor changes to a crosshair, and you
are prompted for a VEC filename in which the points will be saved.
To digitize a point, click the Left mouse. The coords appear in the statusbar.
To check a point, click Shift-Left mouse. The coords appear in the statusbar.
To terminate the session, click the Right mouse. The number of points is
reported in the statusbar, and the file is saved to disk.
Use the Draw Vector File menu item to plot the file on the displayed image.
In this sample file, the points are in client area coordinates. PiXCL 4.4 provides
integer math functions so coordinates can be scaled as needed. ",
"Digitizing Vector files from the application window.",Res)
Goto Wait_for_Input
DrawVectorFileContents: {subroutine}
FileGetSize(VectorFile$,FileSize)
FileRead_ASCII(VectorFile$,0,FileSize,Vectors$,Res)
Instr(Vectors$,Tab$,Loc)
Loc++
Instr(Vectors$,LF$,lfLoc)
Size = lfLoc - Loc
SubStr(Vectors$,Size,Loc,NumPts$)
Val(NumPts$,NumPts,Res)
UsePen(SOLID,PenSize,PenR,PenG,PenB)
ReDraw
WaitInput(1)
RightOf(Vectors$,lfLoc,Vectors$)
GoSub GetCoordPair
x1 = xx1 y1 = yy1
For i=1 To NumPts
GoSub GetCoordPair
x2 = xx1 y2 = yy1
If x2 = 0 Then Break
DrawLine(x1,y1,x2,y2)
x1 = x2 y1 = y2
Next
Beep
Return
GetCoordPair:
Instr(Vectors$,LF$,lfLoc)
If lfLoc = 0 Then xx1 = 0 yy1 = 0 Return
LeftOf(Vectors$,lfLoc,Pair$)
Instr(Pair$,Tab$,TabLoc)
LeftOf(Pair$,TabLoc,xx1$) RightOf(Pair$,TabLoc,yy1$)
Val(xx1$,xx1,Res) Val(yy1$,yy1,Res)
RightOf(Vectors$,lfLoc,Vectors$)
Return
CreateVectorFile: {subroutine}
Field$ = "100 4" + LF$
UseCursor(CROSS)
SetMouse(10,40,Pixels,Lines,GetCoords,x,y)
SetRightMouse(10,40,Pixels,Lines,EndGetCoords,x,y)
SetShftMouse(10,40,Pixels,Lines,TempCoords,x,y)
Counter = 0
WaitInput()
GetCoords:
Str(X,X$) Str(Y,Y$)
Coords$ = X$ + Tab$
Coords$ = Coords$ + Y$
StatusMsg$ = "Point: " + X$
StatusMsg$ = StatusMsg$ +","
StatusMsg$ = StatusMsg$ + Y$
DrawStatusWintext(2,StatusMsg$)
Coords$ = Coords$ + LF$
Field$ = Field$ + Coords$
Counter++
WaitInput()
TempCoords:
Str(X,X$) Str(Y,Y$)
Coords$ = X$ + Tab$
Coords$ = Coords$ + Y$
StatusMsg$ = "Check Point: " + X$
StatusMsg$ = StatusMsg$ +","
StatusMsg$ = StatusMsg$ + Y$
DrawStatusWintext(2,StatusMsg$)
WaitInput()
EndGetCoords:
SetMouse()
SetShftMouse()
SetRightMouse()
UseCursor(ARROW)
DrawStatusWintext(2,"End Digitization")
Ending$ = "0 0"
Field$ = Field$ + Ending$
Str(Counter,Counter$)
GoSub UpdatePointCount
Len(Field$,Long)
FileDelete(VectorFile$,Res)
FileWrite_ASCII(VectorFile$,0,Long,Field$,Res)
FreeVar(Field$)
WaitInput(400)
Msg$ = Counter$ + " points digitized."
DrawStatusWintext(2,Msg$)
WaitInput(400)
DrawStatusWintext(2,"")
ChangeToolbarBtn("Tools",15,ENABLED,Res)
Return
UpdatePointCount:
Instr(Field$,TAB$,Loc) Loc++
Instr(Field$,LF$,LocLF) Extract = LocLF - Loc
SubStr(Field$,Extract,Loc,Num$)
StrRepl(Field$,Num$,Counter$,Res)
Return
Test_TB:
Goto Wait_for_Input
MainFrameMenu:
DrawBackground
SetMenu("&File",IGNORE,
"&New",NewDemo,
"&Open Image",OpenImage,
"&Save Image",CloseImage,
"Save Image &As",CloseImage,
SEPARATOR,
"&New Workbench", NewDemo,
"Open &Workbench",OpenWBH,
"Save Work&bench",CloseWBH,
"Sa&ve Workbench As",CloseWBH,
SEPARATOR,
"E&xit",Leave,
ENDPOPUP,
"&Edit",IGNORE,
"&Undo...Ctrl-Z",Demo,
"Cu&t...Ctrl-X",Demo,
"&Copy...Ctrl-C",Demo,
"&Paste...Ctrl-V",Demo,
"Clear...Del",Demo,
"&Select",Demo,
ENDPOPUP,
"&View",IGNORE,
"&Toolbar",ToggleToolbar,
"&Statusbar",ToggleStatusBar,
"&Current ColorTable",ColorTable,
"Set &Coord Space",Demo,
ENDPOPUP,
"&Help",IGNORE,
"&Contents",Demo,
"&Popup Context",PopupContext,
"&About",About,
"&Test Draw Polygon",Testing,
ENDPOPUP)
Toolbar( RAISED,
STD_SMALL,
NULL, NULL, SEPARATOR, "", Test_TB,
NEW, ENABLED, STD, "FileNew", NewDemo,
OPEN, ENABLED, STD, "FileOpen", OpenImage,
SAVE, ENABLED, STD, "FileSave", CloseImage,
NULL, NULL, SEPARATOR, "", Test_TB,
NULL, NULL, SEPARATOR, "", Test_TB,
CUT, ENABLED, CHECK_G, "Edit: Cut",Demo,
COPY , ENABLED, CHECK_G, "Edit: Copy", Demo,
PASTE, ENABLED, CHECK_G, "Edit: Paste",Demo,
DELETE, ENABLED, CHECK_G, "Edit: Delete", Demo,
REPLACE, ENABLED,CHECK_G,"Edit: Replace",Demo,
REDO, ENABLED, STD, "Redo", Demo,
UNDO, ENABLED, STD, "Undo", Demo,
PRINT, ENABLED, STD, "Print",Demo,
NULL, NULL, SEPARATOR, "", Test_TB,
FIND, ENABLED, STD, "Find", Demo,
PROP, ENABLED, STD,"Properties",Demo,
PPREV, ENABLED, STD, "Print Preview", Demo,
SHOHLP, ENABLED, STD, "Show Help",Demo)
ToolbarStatus = 1
ChangeMenuItem("&Toolbar",CHECK,Res)
ChangeMenuItem("&Statusbar",CHECK,Res)
StatusWindow(ENABLE,BOTTOM,3,200,550,-1,0)
StatusBarView = 1
ToolWindowView = 0
EditBarView = 0
Return
ApplicationFrameMenu:
SetMenu("&File",IGNORE,
"&New",NewDemo,
"&Open Image",OpenImage,
"Save Image",CloseImage,
"Save Image As",CloseImage,
SEPARATOR,
"New Workbench",Demo,
"Open Workbench",OpenWBH,
"Save Workbench",CloseWBH,
"Save Workbench As",CloseWBH,
SEPARATOR,
"P&rinting Files",PrintFileDialog,
SEPARATOR,
"E&xit",Leave,
ENDPOPUP,
"Edit",IGNORE,
"Undo",Demo,
"Cut",Demo,
"Copy...Ctrl-C",Demo,
"Paste...Ctrl-V",Demo,
"Clear",Demo,
"Select",Demo,
ENDPOPUP,
"View",IGNORE,
"&Toolbar",ToggleToolbar,
"&Statusbar",ToggleStatusBar,
"Current ColorTable",ColorTable,
"Set Coord Space",Demo,
ENDPOPUP,
"Overlays",IGNORE,
"Create New Overlay",Demo,
"Import Overlay",ImportOverlayDemo,
"Edit Overlay Color",PopupOpsEdit,
"Edit Pen Styles",EditPenStyles,
SEPARATOR,
"Draw Grid",DrawGrid,
SEPARATOR,
"Clear Image Area", ClearArea,
"Draw Vector Polygon File",DrawVectors,
"Draw Vector Polygon File Set",DrawVectorSet,
SEPARATOR,
"Digitize Vector Polygons",DigitizeVectors,
"Help Digitize Vectors",DigitizeVectorsHelp,
SEPARATOR,
"Draw Map Title",MapTitle,
SEPARATOR,
"Delete Overlay",DeleteOverlayDemo,
"Export Overlay",Demo,
ENDPOPUP,
"Tools",IGNORE,
"Preferences",ToolPreferences,
"Edit Tools",Demo,
ENDPOPUP,
"Map Browser",IGNORE,
"Raster maps",BrowseDemoR,
"Vector maps",BrowseDemoV,
"Sites Maplist",BrowseDemoS,
ENDPOPUP,
"&WorkBench Model",IGNORE,
"&Fire",FireWorkbench,
"F&lood",FloodWorkbench,
"&Transportation",TransportWorkbench,
ENDPOPUP,
"&Help",IGNORE,
"&Contents",Demo,
"&Popup Context",PopupContext,
"&About",About,
"&Test Draw Polygon",Testing,
ENDPOPUP)
Toolbar( RAISED,
STD_SMALL,
NULL, NULL, SEPARATOR, "", Test_TB,
NEW, ENABLED, STD, "FileNew", NewDemo,
OPEN, ENABLED, STD, "FileOpen", OpenImage,
SAVE, ENABLED, STD, "FileSave", CloseImage,
NULL, NULL, SEPARATOR, "", Test_TB,
NULL, NULL, SEPARATOR, "", Test_TB,
CUT, ENABLED, CHECK_G, "Edit: Cut",Demo,
COPY , ENABLED, CHECK_G, "Edit: Copy", Demo,
PASTE, ENABLED, CHECK_G, "Edit: Paste",Demo,
DELETE, ENABLED, CHECK_G, "Edit: Delete", Demo,
REPLACE, ENABLED,CHECK_G,"Edit: Replace",Demo,
REDO, ENABLED, STD, "Redo", Demo,
UNDO, ENABLED, STD, "Undo", Demo,
PRINT, ENABLED, STD, "Print",Demo,
NULL, NULL, SEPARATOR, "", Test_TB,
FIND, ENABLED, STD, "Find", Demo,
PROP, ENABLED, STD,"Properties",Demo,
PPREV, ENABLED, STD, "Print Preview", Demo,
SHOHLP, ENABLED, STD, "Show Help",Demo)
StatusWindow(ENABLE,BOTTOM,3,200,550,-1,0)
ChangeMenuItem("&Toolbar",CHECK,Res)
ChangeMenuItem("&Statusbar",CHECK,Res)
ChangeMenuItem("Edit Overlay Color",UNCHECK,Res)
ToolbarView = 1
EditBarView = 1
StatusBarView = 1
Return
Create_ToolWindow:
If ToolWindowView = 1 Then Return
ToolWindow( 10, 50,112,324,POPUP,"Tools",
RAISED, PXL_LARGE,
ANNOT, ENABLED, STD, "Draw Map Title", MapTitle,
SQSELECT, ENABLED, STD, "Select", Demo,
POLYSELECT, ENABLED, STD, "PolySelect", Demo,
ERASE, ENABLED, STD, "Erase",Demo,
OPENIMAGE, ENABLED, STD, "Import Overlay Image",ImportOverlayDemo,
MIRROR, ENABLED, STD, "Image Mirror", Demo,
FLIP, ENABLED, STD, "Image Flip", Demo,
ROTATE, ENABLED, STD, "Image Rotate",Demo,
SHOWRGB, ENABLED, STD, "Show RGB", Demo,
PICKRGB, ENABLED, CHECK, "Edit Overlay RGB", PopupOpsEdit,
NORMALIZE, ENABLED, STD, "Normalize Image",Demo,
EQUALIZE, ENABLED, STD, "Equalize Image",Demo,
NEGATIVE, ENABLED, STD, "Negative Image",Demo,
IMAGEINFO, ENABLED, STD, "ImageInfo",Demo,
FINGER, ENABLED, CHECK, "Digitize Vectors",DigitizeVectors,
HAND, ENABLED, STD, "Hand", Demo,
FLOOD, ENABLED, STD, "Flood", Demo,
SPRAY, ENABLED, STD, "Spray", Demo,
ZOOMUP, ENABLED, STD, "Positive Zoom", Demo,
ZOOMDN, ENABLED, STD, "Negative Zoom",Demo,
BRUSH, ENABLED, STD, "Brush", Demo)
ToolWindowView = 1
Return
MakeFilter:
Filter$ = "BMP Files(*.bmp),*.bmp,"
Filter$ = Filter$ + "JPEG Files(*.jpg),*.jpg,"
Filter$ = Filter$ + "PCD Files(*.pcd),*.pcd,"
Filter$ = Filter$ + "PCX Files(*.pcx),*.pcx,"
Filter$ = Filter$ + "PNG Files(*.png),*.png,"
Filter$ = Filter$ + "PPM Files(*.ppm),*.ppm,"
Filter$ = Filter$ + "RAS Files(*.ras),*.ras,"
Filter$ = Filter$ + "RLE Files(*.rle),*.rle,"
Filter$ = Filter$ + "TGA Files(*.tga),*.tga,"
Filter$ = Filter$ + "TIF Files(*.tif),*.tif"
Return
MakeVectorFilter:
Filter$ = "DXF Files(*.dxf),*.dxf" {
Filter$ = Filter$ + "JPEG Files(*.jpg),*.jpg,"
Filter$ = Filter$ + "PCD Files(*.pcd),*.pcd,"
Filter$ = Filter$ + "PCX Files(*.pcx),*.pcx,"
Filter$ = Filter$ + "PNG Files(*.png),*.png,"
Filter$ = Filter$ + "PPM Files(*.ppm),*.ppm,"
Filter$ = Filter$ + "RAS Files(*.ras),*.ras,"
Filter$ = Filter$ + "RLE Files(*.rle),*.rle,"
Filter$ = Filter$ + "TGA Files(*.tga),*.tga,"
Filter$ = Filter$ + "TIF Files(*.tif),*.tif" }
Return
CloseAllWorkbenches:
WinExist(WorkbenchTitle$,Res)
If Res = 1 Then WinClose(WorkbenchTitle$,Rxx)
If Res = 1 Then Goto CloseAllWorkbenches
DrawStatusWinText(1,"")
Return
ToolPreferences:
MessageBox(OK,1,INFORMATION,
"Tool preferences for display views can be preset. e.g. a selection
of toolbar buttons, available help files, paint and draw colors and
similar. The specific needs will become more apparent during the
development process.",
"Setting View tool preferences",Res)
Goto Wait_for_Input
Testing:
GoSub PolyLine
Goto Wait_for_Input
PolyLine:
UseBrush(NULL,0,0,0)
UsePen(SOLID,2,255,0,0)
DrawPolygon(151,45,143,48,139,55,118,61,109,73,82,71,81,79,72,81,
66,94,55,89,24,100,12,110,
28,105,38,104,
48,101,51,121,
78,142,78,135,
93,134,103,128,
127,154,159,143,
174,156,171,166,
171,175,163,176,
161,189,147,190,
138,207,125,218,
131,229,194,207,
200,213,200,249,
185,249,159,279,
159,379,162,387)
Return
Initial_Help:
MessageBox(OK,1,INFORMATION,
"This is a sample PiXCL application showing some of
the capability of PiXCL 4.1. Not all menu items, toolbar or
toolwindow buttons have any function coded. If not, a
messagebox appears informing you.
There are two sample images: 'furfcomp.bmp' and
'furtclas.bmp' that are relevent. The first is derived
from LANDSAT Thematic Mapper data, and should be
loaded as the background image. The second is the
result of a classification i.e. it is an overlay image, loaded
when you select an overlay menu or toolbar option.
There are also some sample VEC polygon files which
can be plotted either singly or as a set.",
"Notes on this sample PiXCL file.",Res)
Return